Component({
  properties: {
    tickets: {
      type: Array,
      value: []
    },
    cid: {
      type: Number,
      value: 0
    },
    mid: {
      type: Number,
      value: 0
    },
    day: {
      type: String,
      value: ""
    }
  },

  methods: {
    // 点击跳转选座界面
    onbuyTicket(e) {
      const id = e.currentTarget.dataset.id;
      wx.navigateTo({
        url: '/pages/seat/seat',
        success: (res) => {
          const eventChannel = res.eventChannel;
          eventChannel.emit('acceptDataFromBookingPage', {
            starttime: this.properties.tickets[id].starttime,
            cid: this.properties.cid,
            mid: this.properties.mid,
            day:this.properties.day,
            tickets:this.properties.tickets[id]
          })
        }
      })
    }
  }
});
